#include <mythtv/mythcontext.h>
#include <mythtv/mythdbcon.h>

#include "cdgsettings.h"
#include <qfile.h>
#include <qdialog.h>
#include <qcursor.h>
#include <qdir.h>
#include <qimage.h>


static HostLineEdit *CdgSearchPathCDG()
{
    HostLineEdit *gc = new HostLineEdit("CdgSearchPathCDG");
    gc->setLabel(QObject::tr("Search for CDGs in path"));
    gc->setValue("/mnt/karaoke/CDG");
    gc->setHelpText(QObject::tr("Where to find CDG songs"));
    return gc;
}

static HostLineEdit *CdgSearchPathDVD()
{
    HostLineEdit *gc = new HostLineEdit("CdgSearchPathDVD");
    gc->setLabel(QObject::tr("Search for DVDs in path"));
    gc->setValue("/mnt/karaoke/DVD");
    gc->setHelpText(QObject::tr("Where to find DVDs"));
    return gc;
}

static HostLineEdit *CdgBackgroundPath()
{
    HostLineEdit *gc = new HostLineEdit("CdgBackgroundPath");
    gc->setLabel(QObject::tr("Use background images from this path"));
    gc->setValue("/mnt/karaoke/background");
    gc->setHelpText(QObject::tr("Where to find background images"));
    return gc;
}

#ifdef USING_OPENGL
static HostCheckBox *CdgUseOpenGL()
{
    HostCheckBox *gc = new HostCheckBox("CdgUseOpenGL");
    gc->setLabel(QObject::tr("Use OpenGL"));
    gc->setValue(true);
    gc->setHelpText(QObject::tr("Check this to enable OpenGL "
                                "based animations"));
    return gc;
};
#endif

static HostCheckBox *CdgFrame()
{
    HostCheckBox *gc = new HostCheckBox("CdgUseFrame");
    gc->setLabel(QObject::tr("Draw black frame"));
    gc->setValue(true);
    gc->setHelpText(QObject::tr("If set, a black frame around the graphics is drawn."));
    return gc;
};

static HostCheckBox *CdgTransparency()
{
    HostCheckBox *gc = new HostCheckBox("CdgUseTransparency");
    gc->setLabel(QObject::tr("Use transparency"));
    gc->setValue(true);
    gc->setHelpText(QObject::tr("If set, transparency is used in CDGs."));
    return gc;
};

static HostCheckBox *CdgTransparencyBkg()
{
    HostCheckBox *gc = new HostCheckBox("CdgUseBkgTransparency");
    gc->setLabel(QObject::tr("Use transparent background"));
    gc->setValue(true);
    gc->setHelpText(QObject::tr("If set, the background color is transparent in CDGs."));
    return gc;
};

static HostCheckBox *CdgTransparencyBorder()
{
    HostCheckBox *gc = new HostCheckBox("CdgUseBorderTransparency");
    gc->setLabel(QObject::tr("Use transparent borders"));
    gc->setValue(true);
    gc->setHelpText(QObject::tr("If set, the border color is transparent in CDGs."));
    return gc;
};

static HostLineEdit *CdgDVDPlayer()
{
    HostLineEdit *gc = new HostLineEdit("CdgDVDPlayer");
    gc->setLabel(QObject::tr("Player for DVDs"));
    gc->setValue("xine -pfhq --no-splash dvd://");
    gc->setHelpText(QObject::tr("Which player to use for DVDs"));
    return gc;
}

MythCDGGeneralSettings::MythCDGGeneralSettings()
{
    VerticalConfigurationGroup *general = new VerticalConfigurationGroup(false);
    general->setLabel(QObject::tr("MythCdg Settings -- General"));
    general->addChild(CdgSearchPathCDG());
    general->addChild(CdgSearchPathDVD());
    general->addChild(CdgBackgroundPath());
#ifdef USING_OPENGL
    general->addChild(CdgUseOpenGL());
#endif
    general->addChild(CdgFrame());
    general->addChild(CdgTransparency());
    general->addChild(CdgTransparencyBkg());
    general->addChild(CdgTransparencyBorder());
    general->addChild(CdgDVDPlayer());
    addChild(general);
}



